package com.example.esspringbootrestclientdome.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource("classpath:esConfig.properties")
public class Config {
    @Value("${es.host}")
    private String host;
    @Value("${es.port}")
    private Integer port;
    @Value("${es.user}")
    private String user;
    @Value("${es.password}")
    private String password;
    @Value("${es.index}")
    private String index;

    public String getHost() {
        return host;
    }

    public Integer getPort() {
        return port;
    }

    public String getUser() {
        return user;
    }

    public String getPassword() {
        return password;
    }

    public String getIndex() {
        return index;
    }

    @Override
    public String toString() {
        return "Config{" +
                "host='" + host + '\'' +
                ", port=" + port +
                ", user=" + user +
                ", password=" + password +
                ", index=" + index +
                '}';
    }

}
